import { upgradeLogList } from '@/mock/upgradeLog'
import { RoutesAlias } from './routesAlias'
import { MenuListType } from '@/types/menu'

/**
 * 菜单列表、异步路由
 *
 * 支持两种模式:
 * 1. 前端静态配置 - 直接使用本文件中定义的路由配置
 * 2. 后端动态配置 - 后端返回菜单数据，前端解析生成路由
 *
 * 菜单标题（title）:
 * 可以是 i18n 的 key，也可以是字符串，比如：'用户列表'
 */
export const asyncRoutes: MenuListType[] = [
  {
    id: 2,
    name: 'User',
    path: '/user',
    component: RoutesAlias.Home,
    meta: {
      // title: 'menus.user.title',
      title: '用户管理',
      icon: '&#xe86e;',
      keepAlive: false
    },
    children: [
      {
        id: 301,
        path: 'account',
        name: 'Account',
        component: RoutesAlias.Account,
        meta: {
          // title: 'menus.user.account',
          title:'账号管理',
          keepAlive: false
        }
      },
      {
        id: 302,
        path: 'department',
        name: 'Department',
        component: RoutesAlias.Department,
        meta: {
          // title: 'menus.user.department',
          title:'部门管理',
          keepAlive: false
        }
      },
      {
        id: 303,
        path: 'role',
        name: 'Role',
        component: RoutesAlias.Role,
        meta: {
          // title: 'menus.user.role',
          title:'角色权限',
          keepAlive: false
        }
      },
      {
        id: 305,
        path: 'group',
        name: 'UserGroup',
        component: RoutesAlias.UserGroup,
        meta: {
          title: '账号绑定',
          keepAlive: true,
        }
      }
    ]
  },
  {
    id: 3,
    path: '/menu',
    name: 'Menu',
    component: RoutesAlias.Home,
    meta: {
      title: 'menus.menu.title',
      icon: '&#xe8a4;',
      keepAlive: false
    },
    children: [
      {
        id: 401,
        path: 'menu',
        name: 'Menus',
        component: RoutesAlias.Menu,
        meta: {
          title: 'menus.menu.menu',
          icon: '&#xe8a4;',
          keepAlive: true,
          authList: [
            {
              id: 4011,
              title: '新增',
              auth_mark: 'add'
            },
            {
              id: 4012,
              title: '编辑',
              auth_mark: 'edit'
            },
            {
              id: 4013,
              title: '删除',
              auth_mark: 'delete'
            }
          ]
        }
      },
      {
        id: 411,
        path: 'permission',
        name: 'Permission',
        component: RoutesAlias.Permission,
        meta: {
          title: 'menus.menu.permission',
          icon: '&#xe831;',
          showTextBadge: 'new',
          keepAlive: true,
          authList: [
            {
              id: 4111,
              title: '新增',
              auth_mark: 'add'
            },
            {
              id: 4112,
              title: '编辑',
              auth_mark: 'edit'
            },
            {
              id: 4113,
              title: '删除',
              auth_mark: 'delete'
            }
          ]
        }
      },
      {
        id: 402,
        path: 'nested',
        name: 'Nested',
        component: '',
        meta: {
          title: 'menus.menu.nested',
          icon: '&#xe676;',
          keepAlive: true
        },
        children: [
          {
            id: 40201,
            path: 'menu1',
            name: 'NestedMenu1',
            component: RoutesAlias.NestedMenu1,
            meta: {
              title: 'menus.menu.menu1',
              icon: '&#xe676;',
              keepAlive: true
            }
          },
          {
            id: 40202,
            path: 'menu2',
            name: 'NestedMenu2',
            component: '',
            meta: {
              title: 'menus.menu.menu2',
              icon: '&#xe676;',
              keepAlive: true
            },
            children: [
              {
                id: 4020201,
                path: 'menu2-1',
                name: 'NestedMenu2-1',
                component: RoutesAlias.NestedMenu21,
                meta: {
                  title: 'menus.menu.menu21',
                  icon: '&#xe676;',
                  keepAlive: true
                }
              }
            ]
          },
          {
            id: 40203,
            path: 'menu3',
            name: 'NestedMenu3',
            component: '',
            meta: {
              title: 'menus.menu.menu3',
              icon: '&#xe676;',
              keepAlive: true
            },
            children: [
              {
                id: 4020301,
                path: 'menu3-1',
                name: 'NestedMenu3-1',
                component: RoutesAlias.NestedMenu31,
                meta: {
                  title: 'menus.menu.menu31',
                  icon: '&#xe676;',
                  keepAlive: true
                }
              },
              {
                id: 4020302,
                path: 'menu3-2',
                name: 'NestedMenu3-2',
                component: '',
                meta: {
                  title: 'menus.menu.menu32',
                  icon: '&#xe676;',
                  keepAlive: true
                },
                children: [
                  {
                    id: 402030201,
                    path: 'menu3-2-1',
                    name: 'NestedMenu3-2-1',
                    component: RoutesAlias.NestedMenu321,
                    meta: {
                      title: 'menus.menu.menu321',
                      icon: '&#xe676;',
                      keepAlive: true
                    }
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  // {
  //   id: 9,
  //   path: '/system',
  //   name: 'System',
  //   component: RoutesAlias.Home,
  //   meta: {
  //     title: 'menus.system.title',
  //     icon: '&#xe7b9;',
  //     keepAlive: false
  //   },
  //   children: [
  //     {
  //       id: 901,
  //       path: 'setting',
  //       name: 'Setting',
  //       component: RoutesAlias.Setting,
  //       meta: {
  //         title: 'menus.system.setting',
  //         keepAlive: true
  //       }
  //     },
  //     {
  //       id: 902,
  //       path: 'api',
  //       name: 'Api',
  //       component: RoutesAlias.Api,
  //       meta: {
  //         title: 'menus.system.api',
  //         keepAlive: true
  //       }
  //     },
  //     {
  //       id: 903,
  //       path: 'log',
  //       name: 'Log',
  //       component: RoutesAlias.Log,
  //       meta: {
  //         title: 'menus.system.log',
  //         keepAlive: true
  //       }
  //     }
  //   ]
  // },
  {
    id: 10,
    path: '/chat',
    name: 'Chat',
    component: RoutesAlias.ChatIndex,
    meta: {
      title: '私信管理',
      icon: '&#xe73e;',
      keepAlive: false,
      isInMainContainer: true,
    },
  },
  {
    id: 11,
    path: '/customer',
    name: 'Customer',
    component: RoutesAlias.Home,
    meta: {
      title: '顾客管理',
      icon: '&#xe73a;',
      keepAlive: false,
    },
    children:[
      {
        id:110,
        path: 'tag',
        name: 'CustomerTag',
        component: RoutesAlias.CustomerTag,
        meta: {
          title: '标签管理',
          icon:'&#xe628;',
          keepAlive: false
        }
      },
      {
        id:111,
        path: 'attr',
        name: 'CustomerAttr',
        component: RoutesAlias.CustomerField,
        meta: {
          title: '属性管理',
          icon:'&#xe88c;',
          keepAlive: false
        }
      },
      {
        id:112,
        path: 'index',
        name: 'CustomerIndex',
        component: RoutesAlias.CustomerIndex,
        meta: {
          title: '顾客列表',
          icon: '&#xe64e;',
          keepAlive: false
        }
      }
    ]
  }
]
